package org.NooLab.texx.properties;

import java.util.ArrayList;

public class ControlSettingsSection {

	public ArrayList<String> attributes;
	public ArrayList<String> attrValues;
	
	public int priority;

	// ------------------------------------------------------------------------
	public ControlSettingsSection(){
		
	}
	// ------------------------------------------------------------------------	

	
	public int getIndexOfAttribute( String label){
		int index = -1;
		String str;
		
		if (attributes!=null){
			for (int i=0;i<attributes.size();i++){
				str = attributes.get(i);
				if (str.contentEquals(label)){
					index=i;
					break;
				}
			}// i->
		
		}
		return index;
	}

	public String getValueOfAttribute( String label){
		String attrVal = "";
		int p;
		
		p = getIndexOfAttribute( label) ;
		
		if ((p>=0) && (attrValues!=null) && (p<=attrValues.size()-1)){
			attrVal = attrValues.get(p);
		}
		
		return attrVal;
	}

	
	public String getAttributeAtIndex( int index){
		String label ="";
		int p=index;
		
		if ((p>=0) && (attrValues!=null) && (p<=attrValues.size()-1)){
			label = attrValues.get(p);
		}
		
		return label;
	}
	
	
	
	// ------------------------------------------------------------------------	
	
	public ArrayList<String> getAttributes() {
		return attributes;
	}

	public void setAttributes(ArrayList<String> attributes) {
		this.attributes = attributes;
	}

	public ArrayList<String> getAttrValues() {
		return attrValues;
	}

	public void setAttrValues(ArrayList<String> attrValues) {
		this.attrValues = attrValues;
	}

	public int getPriority() {
		return priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}
	
	
	
	
	
	
}
